#ifndef CURVEDIALOG_H
#define CURVEDIALOG_H

#include <QDialog>
#include <QPair>
#include <QMap>

#include <QComboBox>

//#include "mywidgetlayout.h"
//#include "mywidgetplot.h"

namespace Ui {
class CurveDialog;
}

class CurveDialog : public QDialog
{
    Q_OBJECT

public:
    explicit CurveDialog(const QStringList curveNames, QMap<QString, QWidget*> *tabWidget, QWidget *parent = nullptr);
    ~CurveDialog();

public:
    void resetPageBox();    // 重置页面下拉框
    void resetChartBox();   // 重置曲线下拉框
signals:
    void sendAddTabWidgetData(QMap<QString, QString>);

public slots:
    void setWidgetHide(bool isHide);

    void updateCboxData(QComboBox *comboBox,const QList<QString> &tabs);

    void centerWindow(QWidget *window);
private slots:
    void on_btn_ok_clicked();

    void on_cbox_monitoring_activated(int index);

    void on_cbox_place_page_activated(int index);

    void on_cbox_place_chart_activated(int index);
    void on_ledit_place_page_name_editingFinished();

protected:
    // 添加 showEvent 函数声明
    void showEvent(QShowEvent *event) override;

private:
    Ui::CurveDialog *ui;
    QStringList m_curveNames;
    QMap<QString, QWidget*> *m_tabWidget;

};

#endif // CURVEDIALOG_H
